﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Ewk.Extensions.UnitTests.ReferenceTypeExtensionsTests
{
    [TestClass]
    public class ValidateArgumentForNullTests
    {
        [TestMethod, ExpectedException(typeof(ArgumentNullException))]
        public void ValidateArgumentForNull_must_throw_an_ArgumentNullExeption_when_the_argument_is_null()
        {
            TestClass testClass = null;
            testClass.ValidateArgumentForNull("testArgument");
        }

        [TestMethod]
        public void ValidateArgumentForNull_must_return_the_argument_when_the_argument_is_not_null()
        {
            var testClass = new TestClass();
            var result = testClass.ValidateArgumentForNull("testArgument");

            Assert.IsInstanceOfType(result, typeof(TestClass));
        }

        class TestClass { }
    }
}
